<section class="sidebar">
	<!-- Sidebar user panel -->
	<div class="user-panel">
		<div class="pull-left image">
			<?php echo $this -> Html -> image('avatar3.png', array('class' => 'img-circle', 'alt' => 'User Image')); ?>
		</div>
		<div class="pull-left info">
			<p>
				Hello, <?php echo $user['username'];?>
			</p>

			<a href="#"><i class="fa fa-circle text-success"></i> Online</a>
		</div>
	</div>
	<!-- search form -->
	<form action="#" method="get" class="sidebar-form">
		<div class="input-group">
			<input type="text" name="q" class="form-control" placeholder="Search..."/>
			<span class="input-group-btn">
				<button type='submit' name='seach' id='search-btn' class="btn btn-flat">
					<i class="fa fa-search"></i>
				</button> </span>
		</div>
	</form>
	<!-- /.search form -->
	<!-- sidebar menu: : style can be found in sidebar.less -->
	<ul class="sidebar-menu">
		<li <?php echo $this->request->controller == 'dashboard' ? 'class="active"' : '' ?>>
			<?php 
				echo $this->Html->link(
					$this->Html->tag('i', '', array('class' => 'fa fa-dashboard')) . ' ' .
					$this->Html->tag('span', 'Dashboard'),
					array(
						'controller' => 'dashboard',
						'action' => 'index',
						'admin' => 'true'
					),
					array(
						'escape' => false
					)
				);
			?>
		</li>
		<li <?php echo $this->request->controller == 'PostManage' ? 'class="treeview active"' : 'class="treeview"'?>>
			<?php echo $this->Html->renderMenuItem('Quản lý đăng tin', '#', 'fa fa-building-o', true); ?>
			<ul class="treeview-menu">
				<li>
					<?php echo $this->Html->renderSubMenu('Tin chưa duyệt', array(
						'controller' => 'PostManage',
						'action' => 'index',
						'admin' => 'true'
					)); ?>
				</li>
				<li>
					<?php echo $this->Html->renderSubMenu('Tin đã duyệt', array(
						'controller' => 'PostManage',
						'action' => 'view',
						'admin' => 'true'
					)); ?>
				</li>
			</ul>
		</li>
		
		<li <?php echo $this->request->controller == 'ShopManage' ? 'class="treeview active"' : 'class="treeview"'?>>
			<?php echo $this->Html->renderMenuItem('Quản lý Shop', '#', 'fa fa-building-o', true); ?>
			<ul class="treeview-menu">
				<li>
					<?php echo $this->Html->renderSubMenu('Danh sách shop', array(
						'controller' => 'ShopManage',
						'action' => 'index',
						'admin' => 'true'
					)); ?>
				</li>
			</ul>
		</li>
		
		<li <?php echo $this->request->controller == 'CategoryManage' ? 'class="treeview active"' : 'class="treeview"'?>>
			<?php echo $this->Html->renderMenuItem('Quản lý danh mục', '#', 'fa fa-building-o', true); ?>
			<ul class="treeview-menu">
				<li>
					<?php echo $this->Html->renderSubMenu('Danh mục Chính', array(
						'controller' => 'CategoryManage',
						'action' => 'rindex',
						'admin' => 'true'
					)); ?>
				</li>
				<li>
					<?php echo $this->Html->renderSubMenu('Danh mục', array(
						'controller' => 'CategoryManage',
						'action' => 'index',
						'admin' => 'true'
					)); ?>
				</li>
			</ul>
		</li>
		
		<li <?php echo $this->request->controller == 'BannerManage' ? 'class="treeview active"' : 'class="treeview"'?>>
			<?php echo $this->Html->renderMenuItem('Quản lý Banner', '#', 'fa fa-building-o', true); ?>
			<ul class="treeview-menu">
				<li>
					<?php echo $this->Html->renderSubMenu('Banner', array(
						'controller' => 'BannerManage',
						'action' => 'index',
						'admin' => 'true'
					)); ?>
				</li>
				
				
			</ul>
		</li>
		
		<li <?php echo $this->request->controller == 'MenuManage' ? 'class="treeview active"' : 'class="treeview"'?>>
			<?php echo $this->Html->renderMenuItem('Quản lý Menu footer', '#', 'fa fa-building-o', true); ?>
			<ul class="treeview-menu">
				<li>
					<?php echo $this->Html->renderSubMenu('Menu', array(
						'controller' => 'MenuManage',
						'action' => 'index',
						'admin' => 'true'
					)); ?>
				</li>
				
				
			</ul>
		</li>
		
		<!--
		<li <?php echo $this->request->controller == 'sliders' ? 'class="active"' : '' ?>>
			<?php 
				echo $this->Html->link(
					$this->Html->tag('i', '', array('class' => 'fa fa-dashboard')) . ' ' .
					$this->Html->tag('span', 'Slider'),
					array(
						'controller' => 'sliders',
						'action' => 'index',
						'admin' => 'true'
					),
					array(
						'escape' => false
					)
				);
			?>
		</li>
	-->
		<?php if($user['group_id'] == GROUP_ADMIN) {?>
			<li <?php echo $this->request->controller == 'users' ? 'class="treeview active"' : 'class="treeview"' ?>>
				<?php echo $this->Html->renderMenuItem('Thành viên', '#', 'fa fa-user', true); ?>
				<ul class="treeview-menu">
					<li>
						<?php echo $this->Html->renderSubMenu('Danh sách thành viên', array(
							'controller' => 'Users',
							'action' => 'index',
							'admin' => 'true'
						)); ?>
					</li>
				</ul>
			</li>
		<?php }?>
	</ul>
</section>